<?php

namespace app\api\controller;

use app\api\model\Member;
use app\api\model\Sub;
use Throwable;
use ba\Captcha;
use ba\ClickCaptcha;
use think\facade\Config;
use app\common\facade\Token;
use app\common\controller\Frontend;
use app\api\validate\User as UserValidate;

class User extends Frontend
{
    protected array $noNeedLogin = ['checkIn', 'logout'];

    protected array $noNeedPermission = ['index'];

    public function initialize(): void
    {
        parent::initialize();
    }

    public function getUser(){
        return json((new Member())->getUser($this->request_array));
    }


    public function updateUser(){
        return json((new Member())->updateUser($this->request_array));
    }


    public function loginOut(){
        return json((new Member())->loginOut($this->request_array));
    }


    public function subAccount(){
        return json((new Sub())->subAccount($this->request_array));
    }


    public function submitAccount(){
        return json((new Sub())->submitAccount($this->request_array));
    }


    public function delAccount(){
        return json((new Sub())->delAccount($this->request_array));
    }

}